<?php

/**
 * Abstract Class of Composer
 * @author adesanto_asman@yahoo.com
 * @package Composer
 */

define("_COMPOSER_TYPE_DB"                    , "db");
define("_COMPOSER_TYPE_DB_V2"                 , "dbV2");
define("_COMPOSER_TYPE_QUERY"                 , "query");
define("_COMPOSER_TYPE_MENU"                  , "menu");


include_once "ComposerSourceDb.php";
include_once "ComposerQuery.php";
include_once "Composer/Composer.ComposerSourceDb2.php";

/**
 * Abstract Class Composer
 * @package Composer
 */
class Composer{

  /**
   * type of composer
   *
   * @var string $type
   */
  private $type;

  /**
   * index
   *
   * @var integer $index
   */
  private $index;

  /**
   * key of value
   *
   * @var array  $key
   */
  private $key = array();

  /**
   * value of key
   *
   * @var array  $value
   */
  private $value = array();

  /**
   * init type
   * to return what type of Composer
   *
   * @param string  $type
   * @return object
   */
  function init($type){

    switch($type){

      case _COMPOSER_TYPE_QUERY:

        return new ComposerQuery;

      case _COMPOSER_TYPE_DB:

        return new ComposerSourceDb;

      case _COMPOSER_TYPE_MENU:

        return new ComposerMenu;

      default:
    }
  }

  /**
   * add the identifier
   *
   * @param string  $key
   * @param string  $value
   */
  function add($key, $value){}

  /**
   * del the identifier
   *
   * @param string  $key
   * @param string  $value
   */
  function del($key, $value){}

  /**
   * edit the identifier
   *
   * @param string  $key
   * @param string  $value
   */
  function edit($key, $value){}

  /**
   * fetch the key by value
   *
   * @param string  $value
   * @return string
   */
  function fetchKey($value){}

  /**
   * fetch value by key
   *
   * @param string  $key
   * @return string
   */
  function fetchValue($key){}

  /**
   * fetch the key by value
   *
   * @param string  $value
   * @return string
   */
  function getKey($value){}

  /**
   * fetch value by key
   *
   * @param string  $key
   * @return string
   */
  function getValue($key){}
}

?>